\(\int x \arctan (x) \log (1+x^2) \, dx\) [1278]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 49 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {3 x}{2}-\frac {3 \arctan (x)}{2}-\frac {1}{2} x^2 \arctan (x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right ) \]

[Out]

3/2*x-3/2*arctan(x)-1/2*x^2*arctan(x)-1/2*x*ln(x^2+1)+1/2*(x^2+1)*arctan(x)*ln(x^2+1)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {4946, 327, 209, 2504, 2436, 2332, 5139, 2498} \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=-\frac {1}{2} x^2 \arctan (x)+\frac {1}{2} \left (x^2+1\right ) \arctan (x) \log \left (x^2+1\right )-\frac {3 \arctan (x)}{2}-\frac {1}{2} x \log \left (x^2+1\right )+\frac {3 x}{2} \]

[In]

Int[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x)/2 - (3*ArcTan[x])/2 - (x^2*ArcTan[x])/2 - (x*Log[1 + x^2])/2 + ((1 + x^2)*ArcTan[x]*Log[1 + x^2])/2

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2498

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rule 2504

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[I
nt[x^(Simplify[(m + 1)/n] - 1)*(a + b*Log[c*(d + e*x)^p])^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n, p,
 q}, x] && IntegerQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0]) &&  !(EqQ[q, 1] && ILtQ[n, 0] &&
 IGtQ[m, 0])

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5139

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.))*(x_)^(m_.), x_Symbol] :> With
[{u = IntHide[x^m*(d + e*Log[f + g*x^2]), x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[ExpandIntegrand[u
/(1 + c^2*x^2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && IGtQ[(m + 1)/2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{2} x^2 \arctan (x)+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right )-\int \left (-\frac {x^2}{2 \left (1+x^2\right )}+\frac {1}{2} \log \left (1+x^2\right )\right ) \, dx \\ & = -\frac {1}{2} x^2 \arctan (x)+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right )+\frac {1}{2} \int \frac {x^2}{1+x^2} \, dx-\frac {1}{2} \int \log \left (1+x^2\right ) \, dx \\ & = \frac {x}{2}-\frac {1}{2} x^2 \arctan (x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right )-\frac {1}{2} \int \frac {1}{1+x^2} \, dx+\int \frac {x^2}{1+x^2} \, dx \\ & = \frac {3 x}{2}-\frac {\arctan (x)}{2}-\frac {1}{2} x^2 \arctan (x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right )-\int \frac {1}{1+x^2} \, dx \\ & = \frac {3 x}{2}-\frac {3 \arctan (x)}{2}-\frac {1}{2} x^2 \arctan (x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \arctan (x) \log \left (1+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.78 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {1}{2} \left (3 x-3 \arctan (x)-x^2 \arctan (x)+\left (-x+\left (1+x^2\right ) \arctan (x)\right ) \log \left (1+x^2\right )\right ) \]

[In]

Integrate[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x - 3*ArcTan[x] - x^2*ArcTan[x] + (-x + (1 + x^2)*ArcTan[x])*Log[1 + x^2])/2

Maple [A] (verified)

Time = 1.25 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.98

method result size
parallelrisch \(\frac {x^{2} \arctan \left (x \right ) \ln \left (x^{2}+1\right )}{2}-\frac {x^{2} \arctan \left (x \right )}{2}-\frac {x \ln \left (x^{2}+1\right )}{2}+\frac {\arctan \left (x \right ) \ln \left (x^{2}+1\right )}{2}+\frac {3 x}{2}-\frac {3 \arctan \left (x \right )}{2}\) \(48\)
default \(\text {Expression too large to display}\) \(2222\)
risch \(\text {Expression too large to display}\) \(15978\)

[In]

int(x*arctan(x)*ln(x^2+1),x,method=_RETURNVERBOSE)

[Out]

1/2*x^2*arctan(x)*ln(x^2+1)-1/2*x^2*arctan(x)-1/2*x*ln(x^2+1)+1/2*arctan(x)*ln(x^2+1)+3/2*x-3/2*arctan(x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.67 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=-\frac {1}{2} \, {\left (x^{2} + 3\right )} \arctan \left (x\right ) + \frac {1}{2} \, {\left ({\left (x^{2} + 1\right )} \arctan \left (x\right ) - x\right )} \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x \]

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-1/2*(x^2 + 3)*arctan(x) + 1/2*((x^2 + 1)*arctan(x) - x)*log(x^2 + 1) + 3/2*x

Sympy [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.14 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {x^{2} \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {x^{2} \operatorname {atan}{\left (x \right )}}{2} - \frac {x \log {\left (x^{2} + 1 \right )}}{2} + \frac {3 x}{2} + \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {3 \operatorname {atan}{\left (x \right )}}{2} \]

[In]

integrate(x*atan(x)*ln(x**2+1),x)

[Out]

x**2*log(x**2 + 1)*atan(x)/2 - x**2*atan(x)/2 - x*log(x**2 + 1)/2 + 3*x/2 + log(x**2 + 1)*atan(x)/2 - 3*atan(x
)/2

Maxima [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.80 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=-\frac {1}{2} \, {\left (x^{2} - {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \arctan \left (x\right ) \]

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

-1/2*(x^2 - (x^2 + 1)*log(x^2 + 1) + 1)*arctan(x) - 1/2*x*log(x^2 + 1) + 3/2*x - arctan(x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (39) = 78\).

Time = 0.28 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.76 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {1}{4} \, \pi x^{2} \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \pi x^{2} \mathrm {sgn}\left (x\right ) + \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) + \frac {1}{4} \, \pi \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) - \frac {1}{2} \, \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \frac {3}{2} \, \arctan \left (x\right ) \]

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/4*pi*x^2*log(x^2 + 1)*sgn(x) - 1/2*x^2*arctan(1/x)*log(x^2 + 1) - 1/4*pi*x^2*sgn(x) + 1/2*x^2*arctan(1/x) +
1/4*pi*log(x^2 + 1)*sgn(x) - 1/2*x*log(x^2 + 1) - 1/2*arctan(1/x)*log(x^2 + 1) + 3/2*x - 3/2*arctan(x)

Mupad [B] (verification not implemented)

Time = 0.49 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.98 \[ \int x \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}-x\,\left (\frac {\ln \left (x^2+1\right )}{2}-\frac {3}{2}\right )-x^2\,\left (\frac {\mathrm {atan}\left (x\right )}{2}-\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}\right )-\frac {3\,\mathrm {atan}\left (x\right )}{2} \]

[In]

int(x*log(x^2 + 1)*atan(x),x)

[Out]

(log(x^2 + 1)*atan(x))/2 - x*(log(x^2 + 1)/2 - 3/2) - x^2*(atan(x)/2 - (log(x^2 + 1)*atan(x))/2) - (3*atan(x))
/2